<script type="text/javascript" src="<?=base_url();?>java_scripts/vote_scripts.js"></script>
<div>
   <table border="0" width="100%">
      <tr>
      	<td style="font-size: 20px;font-weight: bold;">Voting Events</td>
      </tr>
      <tr>
      	<td align="center">
      		<table border="0" cellpadding="0" cellspacing="0" width="80%">
      			<tr align="center" bgcolor="#006295" style="color: white;font-size: 14px;">
      				<td width="5%" height="25" style="border-left: 1px solid #006295;">No</td>
      				<td width="20%" height="25" style="border-left: 1px solid #006295;">Topic Name</td>
      				<td width="40%">Start Date</td>
      				<td width="15%">End Date</td>
      				<td width="10%" style="border-right: 1px solid #006295";>Remove</td>
      			</tr>
      			<?php 
      				$color='#DFDFDF';
      				$i=0;
      				foreach($events->result_array() as $event){
      				$i+=1;	
      				$color=($color=='#DFDFDF')?'#EFEFEF':'#DFDFDF';
      			?>
      			<tr align="center" bgcolor="<?=$color?>" style="cursor: pointer;">
      				<td height="25" style="border-left: 1px solid #006295;"><?=$i;?></td>
      				<td><a href="<?=site_url("vote_management/updateEventForm/".$event['event_id'])?>"><?=htmlspecialchars($event['top_name']);?></a></td>
      				<td><?=htmlspecialchars($event['start_date']);?></td>
      				<td><?=htmlspecialchars($event['end_date']);?></td>
      				<td style="border-right: 1px solid #006295";><img width="15" height="15" onclick="javascript:deleteEvent('<?=site_url("vote_management/deleteEvent/".$event['event_id'])?>')"  src="<?=base_url()?>images/recyclebin.png"></td>
      			</tr>
      			<?php 
      				}
      			?>
      			<tr>
      				<td colspan="6" style="border-top:1px solid #006295;">&nbsp;</td>
      			</tr>
      			<tr>
      				<td align="left" colspan="6"><input onclick="javascript:window.location='<?=site_url("misc/homepage")?>'" type="button" value="Back"/>&nbsp;&nbsp;<input type="button" onclick="javascript:window.location='<?=site_url("vote_management/addNewEventForm")?>'" style="cursor: pointer;" value="Add New"/></td>
      			</tr>
      		</table>
      	</td>
      </tr>
   </table>
</div>
